//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using OpenLS.Core;

namespace OpenLS.Drawing
{
    class PropertyUndoUnit<T> : IUndoUnit
    {
        private readonly Action<T> _action;
        private readonly T _value;
        public PropertyUndoUnit(Action<T> action, T value)
        {
            Contract.Requires(action != null);
            _action = action;
            _value = value;
        }
        public void Do()
        {
            _action(_value);
        }
        public bool Merge(IUndoUnit unit)
        {
            return false;
        }
    }
}